<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="uploads.action" method="POST" enctype="multipart/form-data">
    <table id="tab">
        <tr>
            <td>选择文件:<input type="file" name="uploads"></td>
        </tr>
        <tr>
            <td>
                <input type="submit" value="上传">
                <input type="button" value="添加一个上传文件" onclick="insertRow()">
            </td>
        </tr>
    </table>
</form>

</body>
<script>
    function insertRow() {
        var myTab = document.getElementById("tab");//获得tab的对象
        var newRow = myTab.insertRow(myTab.rows.length - 1);
        newRow.insertCell(0).innerHTML = "选择文件:<input type=\"file\" name=\"uploads\">";
    }
</script>
</html>
